<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="pc/include :: header('积分兑换')" />

    <link th:href="@{/js/ui-table/ui-table.css}" rel="stylesheet"/>
</head>
<body>
<th:block th:include="pc/include :: top" />
<div class="iw">
    <div class="crumbs">
        <p>当前位置：<a href="/">首页</a> > <a href="/user/center">个人中心</a> > 积分兑换</p>
    </div>
    <div class="center_left">
        <th:block th:include="pc/include :: menu" />
    </div>
    <div class="center_right">

            <span th:if="${message}" th:text="${message}" style="font-size: 20px;color:#f60"></span>
            <form th:if="${message}==''" id="form_change" action="/user/changeout" method="post">
                <h1 class="vip_head">兑换</h1>     
                <div class="cash_stepzero unselect">
                    <h3>1.积分兑换</h3>
                    <div class='ui-text-group'>
                        <input id="points" name="points" type="number" th:value="${tradeset.pointout}" class="ui-text" data-valid data-must="必须输入数量" data-reg="^\d*$" data-reg-msg="请输入正确数量" th:attr="data-min=${tradeset.pointout},data-max=${user.points}" /><span></span>
                        <lable>请输入兑换数量</lable>
                    </div>
                </div>
                <div class="vip_stepthr">
                    <h3>2.所得交易币 <span id="vip_cash" th:text="${tradeset.pointout * tradeset.pointrate}"></span> <span th:text="${tradeset.glodname}" th:remove="tag"></span> , <tip>兑换交易币 = 积分数量 * 积分兑换比例(<span th:text="${tradeset.pointrate}" th:remove="tag"></span>)</tip></h3>
                    <span class="ui-btn"><a submit='#form_change' tip='确认提交?'>我要兑换</a></span>
                </div>
            </form>
    </div>
</div>
<th:block th:include="pc/include :: footer" />
<script th:src="@{/js/nstSlider/jquery.nstSlider.min.js}"></script>
<script>
    $(function () {
        $("#points").change(function() {
            id = $(this).val();
            $("#vip_cash").text((id * Number('[(${tradeset.pointrate})]')).toFixed(2));
        });
    });
</script>